package com.etp.actions;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.etp.forms.LoginForm;

public class LoginAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			ServletRequest request, ServletResponse response) throws Exception {

		LoginForm mloginForm = (LoginForm)form;
		if(mloginForm.getUsername().equalsIgnoreCase("SURYA") 
				&& mloginForm.getPassword().equals("surya")){
			return mapping.findForward("success");
		}
		//return super.execute(mapping, form, request, response);
		return mapping.findForward("fail");
	}
}
